<?php
    include('../config.ini.php');
    include('function.php');
    
    $db = db_connect();
    
    $plan_id = $_POST['plan_id'];
    
    $sql = "SELECT * FROM house_plan WHERE plan_id=$plan_id";
    $result = mysql_query($sql);
    $row = mysql_fetch_assoc($result);
    
    $house_['img1'] = $row['style_id'].'/'.$row['plan_id'].'/'.$row['plan_img_1'];
    $house_['img2'] = $row['style_id'].'/'.$row['plan_id'].'/'.$row['plan_img_2'];
    $house_['img3'] = $row['style_id'].'/'.$row['plan_id'].'/'.$row['plan_img_3'];
    $house_['plan_name'] = $row['plan_name'];
    $house_['plan_size'] = $row['plan_size'];
    $house_['plan_dimension_x'] = $row['plan_dimension_x'];
    $house_['plan_dimension_y'] = $row['plan_dimension_y'];
    $house_['plan_detail'] = $row['plan_detail'];
    if($row['style_id']==1){
        $house_['plan_style'] = 'CONTEMPORARY STYLE';
    }else{
        $house_['plan_style'] = 'MODERN STYLE';
    }
    
    echo json_encode($house_);
    
    db_close($db);
?>